
let fs = require("fs")

let titles = require("./strings_items.js")

let items = fs.readFileSync("./itemDatabaseJson.json").toString();

let items_ret = items.replace(/"titleKey": (\d+),/ig, (v, v1) => {
    if(titles[v1] && /"/.test(titles[v1])){
        titles[v1] = titles[v1].replace(/"/g, "'")
    }
    return `"titleKey": "${titles[v1]||v1}",`
})

fs.writeFileSync("./items_tmp.js", "let items = " + items_ret)
// "titleKey": 875,